;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Max dimension of available window functions
-(defun which-key--popup-max-dimensions (selected-window-width)
+(defun which-key--popup-max-dimensions ()
"Dimesion functions should return the maximum possible (height
. width) of the intended popup. SELECTED-WINDOW-WIDTH is the
width of currently active window, not the which-key buffer
(minibuffer (which-key--minibuffer-max-dimensions))
(side-window (which-key--side-window-max-dimensions))
(frame (which-key--frame-max-dimensions))
- (custom (funcall which-key-custom-popup-max-dimensions-function selected-window-width))))
+ (custom (funcall which-key-custom-popup-max-dimensions-function
+ (window-width)))))
(defun which-key--minibuffer-max-dimensions ()
"Return max-dimensions of minibuffer (height . width).
:keys/page (reverse keys/page) :n-pages n-pages
:tot-keys (apply #'+ keys/page)))))
-(defun which-key--create-pages (keys sel-win-width)
+(defun which-key--create-pages (keys)
"Create page strings using `which-key--partition-columns'.
Will try to find the best number of rows and columns using the
given dimensions and the length and wdiths of KEYS. SEL-WIN-WIDTH
is the width of the live window."
- (let* ((max-dims (which-key--popup-max-dimensions sel-win-width))
+ (let* ((max-dims (which-key--popup-max-dimensions))
(max-lines (car max-dims))
(max-width (cdr max-dims))
(prefix-keys-desc (key-description which-key--current-prefix))
(let (pages1)
(let ((which-key-side-window-location loc1)
(which-key--multiple-locations t))
- (setq pages1 (which-key--create-pages keys (window-width))))
+ (setq pages1 (which-key--create-pages keys)))
(if (< 0 (plist-get pages1 :n-pages))
(progn
(setq which-key--pages-plist pages1)
loc1)
(let ((which-key-side-window-location loc2)
(which-key--multiple-locations t))
- (setq which-key--pages-plist (which-key--create-pages
- keys (window-width)))
+ (setq which-key--pages-plist
+ (which-key--create-pages keys))
(which-key--show-page page-n)
loc2))))
(apply #'which-key--try-2-side-windows
formatted-keys 0 which-key-side-window-location)))
(t (setq which-key--pages-plist
- (which-key--create-pages formatted-keys (window-width)))
+ (which-key--create-pages formatted-keys))
(which-key--show-page 0)))))
(let* ((key (key-description (list (read-key))))
(next-def (lookup-key keymap (kbd key))))
(apply #'which-key--try-2-side-windows
formatted-keys 0 which-key-side-window-location)))
(t (setq which-key--pages-plist
- (which-key--create-pages formatted-keys (window-width)))
+ (which-key--create-pages formatted-keys))
(which-key--show-page 0)))))
(let* ((key (key-description (list (read-key)))))
(when (string= key "`")
(apply #'which-key--try-2-side-windows
formatted-keys 0 which-key-side-window-location)))
(t (setq which-key--pages-plist
- (which-key--create-pages formatted-keys (window-width)))
+ (which-key--create-pages formatted-keys))
(which-key--show-page 0)))))
(defun which-key--update ()